package com.samoiloff.ui.btns.bright {
	import caurina.transitions.Tweener;

	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	import flash.text.TextField;

	/**
	 * @author Damirr
	 */
	public class BrightTextBtnController extends BrightBtnController {
		
		private var _tf:TextField;
	
		public function BrightTextBtnController(mc: MovieClip, label:String = "Label") {
			super(mc);
			_tf = mc.tf;
//			Fonts.getInstance().applyDefaultFont(_tf, true);
			_tf.mouseEnabled =false;
			
			this.label = label; 
		}
		
		public function get label(): String {
			return _tf.text;
		}
		
		public function set label(label: String): void {
			_tf.text = label;
		}
		
		override protected function onMouseOver(e:MouseEvent): void {
			Tweener.removeTweens(_mc);
			Tweener.addTween(_mc, {time:.5, transition:"easeOutCubic", _brightness:.4});
			dispatchEvent(e);
		}

		override protected function onMouseOut(e:MouseEvent): void {
			Tweener.removeTweens(_mc);
			Tweener.addTween(_mc, {time:.5, transition:"easeOutCubic", _brightness:0});
			dispatchEvent(e);
		}
	}
}
